#include<iostream>
using namespace std;
 int main(){
 	unsigned long n,k,test,r=1,value=0;
	cin>>n>>k; 	
 	test=1<<(n-1);
 	while(test){
		r=(test&k?r*2:r*2-1);
		if(r%4==2||r%4==3) value=value|test;
		test=test>>1;
	}
	test=1<<(n-1);
	while(test){
		if(test&value) cout<<1; else cout<<0;
		test=test>>1;
	}
 }
 
